package com.smedi.ismedi.inmail.api.feign;

import com.smedi.ismedi.inmail.api.dto.request.appPush.NotificationMessageRequest;
import com.smedi.ismedi.inmail.api.dto.request.appPush.TransmissionMessageRequest;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;

/**
 * 发布通知公告FeignApi
 *
 * @author jiangqinxuan
 * @date 2021/07/26
 */
@FeignClient(name = "ismedi-inmail")
@Api(value = "数据中台", tags = {"数据中台"})
@RequestMapping(value = "/api/v1/dataMiddlePlatform")
public interface RemoteDataMiddlePlatformFeignApi {

    /**
     * 查询天气
     *
     * @param cityName 城市名字
     * @param date     日期
     * @return ResponseData<String> 天气
     */
    @ApiOperation(httpMethod = "GET", value = "查询天气")
    @GetMapping(value = "/weather")
    ResponseData<String> getWeather(@RequestParam(value = "cityName") String cityName,
                                    @RequestParam(value = "date") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date);
    /**
     * APP推送透传消息
     *
     * @param passThroughMessage 透传消息传参
     * @return ResponseData<String>
     */
    @ApiOperation(httpMethod = "POST", value = "APP推送透传消息单推")
    @PostMapping(value = "/pushPassThroughMessageSingle")
    ResponseData<String> pushPassThroughMessageSingle(@Validated @RequestBody TransmissionMessageRequest passThroughMessage);
    /**
     * APP推送透传消息
     *
     * @param passThroughMessage 透传消息传参
     * @return ResponseData<String>
     */
    @ApiOperation(httpMethod = "POST", value = "APP推送透传消息批量推")
    @PostMapping(value = "/pushPassThroughMessageBatch")
    ResponseData<String> pushPassThroughMessageBatch(@Validated @RequestBody TransmissionMessageRequest passThroughMessage);
    /**
     * APP推送通知消息
     *
     * @param notificationMessage 通知消息传参
     * @return ResponseData<String>
     */
    @ApiOperation(httpMethod = "POST", value = "APP推送通知消息")
    @PostMapping(value = "/pushNotificationMessage")
    ResponseData<String> pushNotificationMessage(@Validated @RequestBody NotificationMessageRequest notificationMessage);
}
